const devConfig = process.env.NODE_ENV === 'development'
  ? {
      pages: [
        'pages/_dev/index',
      ],
      tabBar: {
        list: [
          {
            pagePath: 'pages/_dev/index',
            text: '开发',
            iconPath: './assets/images/app.png',
            selectedIconPath: './assets/images/app-selected.png',
          },
        ],
      },
    }
  : { pages: [], tabBar: { list: [] } }

export default defineAppConfig({
  ...devConfig,
  pages: [
    ...(devConfig.pages || []),
    'pages/index/index',
    'pages/quiz/index',
    'pages/review/index',
    'pages/wrong/index',
  ],
  window: {
    navigationStyle: 'custom',
    backgroundTextStyle: 'light',
    navigationBarBackgroundColor: '#fff',
    navigationBarTitleText: 'WeChat',
    navigationBarTextStyle: 'black',
  },
  tabBar: {
    selectedColor: '#17abe3',
    list: [
      ...devConfig.tabBar?.list,
      {
        pagePath: 'pages/index/index',
        text: '首页',
        iconPath: './assets/images/home.png',
        selectedIconPath: './assets/images/home-selected.png',
      },
      {
        pagePath: 'pages/quiz/index',
        text: '答题',
        iconPath: './assets/images/doc.png',
        selectedIconPath: './assets/images/doc-selected.png',
      },
      {
        pagePath: 'pages/review/index',
        text: '复习',
        iconPath: './assets/images/todo.png',
        selectedIconPath: './assets/images/todo-selected.png',
      },
      {
        pagePath: 'pages/wrong/index',
        text: '错题',
        iconPath: './assets/images/todo.png',
        selectedIconPath: './assets/images/todo-selected.png',
      },
    ],
  },
})
